<template>
  <el-form :model="detailForm" ref="detailForm" :inline="false"
           :class="isEdit?'':'formItem'" :label-position="labelPosition">

    <!-- 用印文件 -->
    <el-card class="box-card" shadow="never">

      <div slot="header" class="header-card">
        <span class="header-card-title">用印文件</span>
      </div>

      <el-row :gutter="24">

        <el-col :span="24">
          <el-form-item label="上传用印文件:" >
            <image-common v-model="detailForm.useSealsOss" :limit="1" :disabled="!isEdit" :upType="2"/>
          </el-form-item>
        </el-col>

      </el-row>
    </el-card>

  </el-form>
</template>

<script>
export default {
  name: 'printedDocument',//用印文件
  props: {
    value: {
      type: Object,
      default: {},
    },
    state: {
      type: String,
      default: "",
    },
  },
  computed: {
    detailForm: {
      get() {
        let that = this;
        const proxy = new Proxy(that.value, {
          get(target, key) {
            return Reflect.get(target, key);
          },
          set(target, key, value) {
            that.$emit("input", { ...target, [key]: value });
            return true;
          },
        });
        return proxy;
      },
    },
    labelPosition() {
      if(this.isEdit){
        return 'top'
      }else{
        return 'right'
      }
    },
    isEdit() {
      let bool;
      switch (this.state) {
        case "write":
          bool = true;
          break;
        case "disabled":
          bool = false;
          break;
        case "readonly":
          bool = false;
          break;
      }
      return bool
    },
  },
  watch: {},
  data() {
    return {};
  },
  created() {
  },
  mounted() {
  },
  methods: {},
};
</script>

<style lang="scss" scoped>
@import "@/styles/cwgd/formScss.scss";
</style>


